Skip to content

Name what still holds a listed AppKit window - #30

Merged
bytetroll merged 1 commit into
masterfrom
appkit-window-owner-diagnostics
Nov 9, 2026
Merged

bytetroll merged 1 commit into
masterfrom
appkit-window-owner-diagnostics

Conversation

@bytetroll

Copy link
Copy Markdown
Contributor

The settle loop ran its full half second and the count stayed at one, so the window is not merely waiting on AppKit's bookkeeping; something is holding it. Rather than guess a third time, the observer now names every window still listed, with its title, content view class, visibility, releasedWhenClosed flag and retain count. That distinguishes the toolkit keeping a closed window alive from an owner that never let go, and the fixture is compiled without ARC so the count is readable.

Context::clear() also loses a condition I added without evidence. It required pthread_main_np() as well as a matching owning thread before disposing, where the other providers dispose on a matching owner alone. A context can only be used on the main thread, so a matching owner is already the main thread and the extra test could only defer a disposal the others perform at once -- which is exactly the shape of this failure. If that was the cause this fixes it, and if not the diagnostics say what is.

The settle loop ran its full half second and the count stayed at one, so
the window is not merely waiting on AppKit's bookkeeping; something is
holding it. Rather than guess a third time, the observer now names every
window still listed, with its title, content view class, visibility,
releasedWhenClosed flag and retain count. That distinguishes the toolkit
keeping a closed window alive from an owner that never let go, and the
fixture is compiled without ARC so the count is readable.

Context::clear() also loses a condition I added without evidence. It
required pthread_main_np() as well as a matching owning thread before
disposing, where the other providers dispose on a matching owner alone.
A context can only be used on the main thread, so a matching owner is
already the main thread and the extra test could only defer a disposal
the others perform at once -- which is exactly the shape of this
failure. If that was the cause this fixes it, and if not the diagnostics
say what is.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@bytetroll
bytetroll merged commit d2bc9aa into master Nov 9, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant